﻿<%@ page contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<head>
<title>用户编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../style/adminStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>

<script type="text/javascript">


function updateuser(id) {
	
	var password=$("#password").val();
	var integral=$("#integral").val();
	var balance=$("#balance").val();
	var systems=$("#systems").val();
	var whetheradminis=$("#admin").val();

	var msg = "您确定要修改吗？\n\n请确认！";
	if (confirm(msg)==true){	
		$.ajax({
			"url":"${pageContext.request.contextPath}/Administrators/edit_product1.do",
			"data":{'id':id,'password':password,'integral':integral,'balance':balance
				,'systems':systems,'whetheradminis':whetheradminis},
			"type":"POST",
			"dataType":"json",
			"success":function(obj){

				if(obj.state==1){
					alert("修改成功");
					location="${pageContext.request.contextPath}/Administrators/product_list.do?system="+systems;
					
				}else{
					alert("修改失败");
				}
		
			}});
		
	return true;
	}else{
	return false;
	}
	};


</script>
</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="add"></i><em>编辑/修改用户</em></span>
   <!--  <span class="modular fr"><a href="product_list.do" class="pt-link-btn">产品列表</a></span> -->
  </div>
  
  
  <table class="list-style">
   <tr>
    <td style="text-align:right;">用户id：</td>
    <td><input type="text" class="textBox length-long" value="${user.id}" style="color: #C0C0C0" readonly="readonly"/></td>
   </tr>
    <tr>
    <td style="text-align:right;">用户名称：</td>
    <td><input type="text" class="textBox length-long" value="${user.nickname}" style="color: #C0C0C0" readonly="readonly"/></td>
   </tr>
   <tr>
    <td style="text-align:right;width:15%;">用户账号：</td> 
    <td ><input type="text" class="textBox length-long" value="${user.accountNumber}" style="color: #C0C0C0" readonly="readonly"/></td>
   </tr>
    <tr>
    <td style="text-align:right;width:10%;">用户密码：</td> 
    <td><input type="text" class="textBox length-long" value="${user.password}" name="password" id="password" /></td>
   </tr>
   <tr>
    <td style="text-align:right;width:10%;">用户积分：</td>
    <td><input type="text" class="textBox length-long" value="${user.integral}" name="integral" id="integral" /></td>
   </tr>
   <tr>
    <td style="text-align:right;width:10%;">用户余额：</td>
    <td><input type="text" class="textBox length-long" value="${user.balance}" name="balance" id="balance" /></td>
   </tr>
   <tr>
    <td style="text-align:right;width:10%;">用户手机：</td>
    <td><input type="text" class="textBox length-long" value="${user.phone}" name="phone" id="phone" style="color: #C0C0C0" readonly="readonly"/>
    </td>
   </tr>
 	<tr>
    <td style="text-align:right;width:10%;">手机系统：</td>
    <td><input type="text" class="textBox length-long" value="${user.systems}" name="systems" id="systems" style="color: #C0C0C0" readonly="readonly"/>
    </td>
   </tr>
    <tr>
     <td style="text-align:right;width:10%;">是否群管理：</td>
   <td >
    <select class="textBox" id="admin">
    <c:if test="${user.whetheradminis==null}">
      <option value="0">否</option>
      <option value="1">是</option>
      </c:if>
       <c:if test="${user.whetheradminis==0}">
      <option value="0">否</option>
      <option value="1">是</option>
      </c:if>
       <c:if test="${user.whetheradminis==1}">
      <option value="1">是</option>
      <option value="0">否</option>
      </c:if>
     </select>
     </td>
     </tr>
   <tr>
    <td style="text-align:right;"></td>
    <td><input  type="submit" value="确认修改" class="tdBtn" onclick="return updateuser(${user.id})"/></td>
   </tr>
  
  </table>

 </div>
</body>
</html>